﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Urb.Weather.Core.Engine
{
    public delegate void EngineStateChangedEventHandler(IEngine sender, EngineState engineState);

    public interface IEngine
    {
        event EngineStateChangedEventHandler StateChanged;

        EngineState State { get; }

        void Start();
        void RequestStop();
        void Stop();

        void Queue(IWorkItem workItem);
        void Queue(IDownloadStringWorkItem workItem);

        IWorkItemRegistrationToken Queue(IWorkItem workItem, IPeriod period, TimeSpan initialDue);
        IWorkItemRegistrationToken Queue(IDownloadStringWorkItem workItem, IPeriod period, TimeSpan initialDue);

        void Dequeue(IWorkItemRegistrationToken token);
    }
}
